package task2;

import com.sun.org.apache.xpath.internal.SourceTree;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;

/**
 * //通知类
 */
public class Notifier {

    public static void notifyEnter(){
        System.out.println("请输入裁判人数：");
        Scanner scanner=new Scanner(System.in);
        //接受输入的裁判数
        int num=scanner.nextInt();

        ArrayList arrayList=new ArrayList();

        System.out.println("请输入分数：已回车键结束");
        for(int i=0;i<num;i++){
            //接受输入的分数
            float f=scanner.nextFloat();
            //分数保存在集合中
            arrayList.add(f);
        }
        //测试
       // Iterator iterator=arrayList.iterator();
       // while (iterator.hasNext()){
       //     System.out.println(iterator.next()+"\t");
       // }

        //将集合传递给computer
        Computer computer=new Computer();
        computer.setList(arrayList);
        //调用输入的裁判数
        System.out.println("去掉最高分："+computer.max());
        System.out.println("去掉最低分："+computer.min());
        System.out.println("最后得分："+computer.avg());
    }
}
